home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_q_t
/
trem.zip
/
EVENT.C
< prev
next >
Wrap
Text File
|
1991-05-11
|
2KB
|
60 lines
/************************************************************************
*
* Copyright (c) 1991 Microsoft Corporation. All Rights Reserved.
*
*-----------------------------------------------------------------------
*
* Project: Windows Terminal Example
*
* Module: event.c
*
* Author: Bryan A. Woodruff (baw)
*
*
* Remarks: This handles the RX_CHAR event on received characters
*
* Revisions:
* 01.00.000 5/10/91 baw Wrote it.
*
************************************************************************/
#include "terminal.h"
/************************************************************************
* BOOL ProcessRxEvent( HWND hWnd, WORD wParam, LONG lParam )
*
* Description:
* Processes an EV_RXCHAR event for the COM port.
*
* Comments:
* 5/10/91 baw Wrote it
*
************************************************************************/
BOOL ProcessRxEvent( HWND hWnd, WORD wParam, LONG lParam )
{
int nLength ;
BYTE abIn[ MAXBLOCK + 1] ;
LOCALHANDLE hTermInfo ;
NPTERMINFO npTermInfo ;
hTermInfo = GetWindowWord( hWnd, GWW_TERMINFO ) ;
if (NULL == (npTermInfo = (NPTERMINFO) LocalLock( hTermInfo )))
return ( FALSE ) ;
ClearEvent( hWnd, npTermInfo -> nCid, EV_RXCHAR ) ;
nLength = ReadCommBlock( hWnd, (LPSTR) abIn, MAXBLOCK ) ;
if (nLength > 0)
WriteTerminalBlock( hWnd, (LPSTR) abIn, nLength ) ;
LocalUnlock( hTermInfo ) ;
return ( TRUE ) ;
} /* end of ProcessRxEvent() */
/************************************************************************
* End of File: event.c
************************************************************************/